object fraAddress: TfraAddress
  Left = 0
  Top = 0
  Width = 258
  Height = 410
  TabOrder = 0
  object SearchBox: TGroupBox
    Left = 0
    Top = 0
    Width = 258
    Height = 410
    Align = alClient
    Caption = ' '#1042#1099#1073#1086#1088' '#1072#1076#1088#1077#1089#1072' '
    Constraints.MinHeight = 200
    Constraints.MinWidth = 258
    TabOrder = 0
    object SubPanel: TPanel
      Left = 2
      Top = 15
      Width = 254
      Height = 393
      Align = alClient
      BevelOuter = bvNone
      Font.Charset = DEFAULT_CHARSET
      Font.Color = clWindowText
      Font.Height = -11
      Font.Name = 'MS Sans Serif'
      Font.Style = []
      ParentFont = False
      TabOrder = 0
      object Label9: TLabel
        Left = 30
        Top = 250
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label8: TLabel
        Left = 30
        Top = 230
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label6: TLabel
        Left = 30
        Top = 10
        Width = 69
        Height = 13
        Caption = #1051#1080#1094#1077#1074#1086#1081' '#1089#1095#1077#1090
      end
      object Label7: TLabel
        Left = 30
        Top = 210
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label5: TLabel
        Left = 72
        Top = 35
        Width = 27
        Height = 13
        Caption = #1060#1048#1054
      end
      object Label4: TLabel
        Left = 51
        Top = 131
        Width = 48
        Height = 13
        Caption = #1050#1074#1072#1088#1090#1080#1088#1072
      end
      object Label3: TLabel
        Left = 76
        Top = 107
        Width = 23
        Height = 13
        Caption = #1044#1086#1084
      end
      object Label2: TLabel
        Left = 67
        Top = 83
        Width = 32
        Height = 13
        Caption = #1059#1083#1080#1094#1072
      end
      object Label12: TLabel
        Left = 30
        Top = 310
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label11: TLabel
        Left = 30
        Top = 290
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label10: TLabel
        Left = 30
        Top = 270
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label1: TLabel
        Left = 48
        Top = 59
        Width = 51
        Height = 13
        Caption = #1053#1072#1089'.'#1087#1091#1085#1082#1090
      end
      object Label13: TLabel
        Left = 30
        Top = 370
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label14: TLabel
        Left = 30
        Top = 350
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object Label15: TLabel
        Left = 30
        Top = 330
        Width = 69
        Height = 13
        Alignment = taRightJustify
        AutoSize = False
        Caption = #1044#1086#1087'. 1'
        Visible = False
      end
      object TownBox: TDBLookupComboboxEh
        Left = 104
        Top = 56
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        KeyField = 'CODE'
        ListField = 'NAME'
        ListFieldIndex = -1
        ListSource = ds_QTowns
        TabOrder = 2
        Visible = True
        OnChange = TownBoxChange
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object StreetBox: TDBLookupComboboxEh
        Left = 104
        Top = 80
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        KeyField = 'CODE'
        ListField = 'STREET'
        ListFieldIndex = -1
        ListSource = ds_QStreets
        TabOrder = 3
        Visible = True
        OnChange = StreetBoxChange
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object NLSEdit: TDBEditEh
        Left = 104
        Top = 8
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        TabOrder = 0
        Visible = True
        OnExit = NLSEditExit
        OnKeyPress = TownBoxKeyPress
      end
      object NameEdit: TDBEditEh
        Left = 104
        Top = 32
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        EditButtons = <>
        Flat = True
        TabOrder = 1
        Visible = True
        OnKeyPress = TownBoxKeyPress
      end
      object HouseBox: TDBLookupComboboxEh
        Left = 104
        Top = 104
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NUM'
        ListFieldIndex = -1
        ListSource = ds_QHouses
        TabOrder = 4
        Visible = True
        OnChange = HouseBoxChange
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object FindBtn: TButton
        Left = 8
        Top = 152
        Width = 75
        Height = 25
        Caption = #1048#1089#1082#1072#1090#1100
        TabOrder = 12
      end
      object dbt2: TDBDateTimeEditEh
        Left = 104
        Top = 308
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Enabled = False
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 6
        Visible = False
      end
      object dbt1: TDBDateTimeEditEh
        Left = 104
        Top = 288
        Width = 121
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Enabled = False
        EditButtons = <>
        Flat = True
        Kind = dtkDateEh
        TabOrder = 7
        Visible = False
      end
      object dbn2: TDBNumberEditEh
        Left = 104
        Top = 228
        Width = 146
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Enabled = False
        EditButtons = <>
        Flat = True
        TabOrder = 8
        Visible = False
      end
      object dbn1: TDBNumberEditEh
        Left = 104
        Top = 208
        Width = 146
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        Enabled = False
        EditButtons = <>
        Flat = True
        TabOrder = 9
        Visible = False
      end
      object dbe2: TDBEditEh
        Left = 104
        Top = 268
        Width = 145
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        EditButtons = <>
        Enabled = False
        Flat = True
        TabOrder = 10
        Visible = False
      end
      object dbe1: TDBEditEh
        Left = 104
        Top = 248
        Width = 145
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        EditButtons = <>
        Enabled = False
        Flat = True
        TabOrder = 11
        Visible = False
      end
      object ClearBtn: TButton
        Left = 88
        Top = 152
        Width = 75
        Height = 25
        Caption = #1054#1095#1080#1089#1090#1080#1090#1100
        TabOrder = 13
        OnClick = ClearBtnClick
      end
      object AppartBox: TDBLookupComboboxEh
        Left = 104
        Top = 128
        Width = 146
        Height = 19
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        KeyField = 'ID'
        ListField = 'NUM'
        ListFieldIndex = -1
        ListSource = ds_QApparts
        TabOrder = 5
        Visible = True
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object AddBtn: TButton
        Left = 168
        Top = 152
        Width = 83
        Height = 25
        Caption = #1056#1072#1089#1096#1080#1088#1077#1085#1085#1099#1081
        TabOrder = 14
      end
      object lcb1: TDBLookupComboboxEh
        Left = 104
        Top = 328
        Width = 146
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        ListFieldIndex = -1
        TabOrder = 15
        Visible = False
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object lcb2: TDBLookupComboboxEh
        Left = 104
        Top = 348
        Width = 146
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        ListFieldIndex = -1
        TabOrder = 16
        Visible = False
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object lcb3: TDBLookupComboboxEh
        Left = 104
        Top = 368
        Width = 146
        Height = 19
        TabStop = False
        AlwaysShowBorder = True
        DropDownBox.Sizable = True
        EditButtons = <>
        Flat = True
        ListFieldIndex = -1
        TabOrder = 17
        Visible = False
        OnCloseUp = TownBoxCloseUp
        OnEnter = TownBoxEnter
        OnKeyPress = TownBoxKeyPress
      end
      object cb1: TDBCheckBoxEh
        Left = 12
        Top = 288
        Width = 50
        Height = 17
        AllowGrayed = True
        AlwaysShowBorder = True
        Caption = 'cb1'
        Flat = True
        TabOrder = 18
        TabStop = False
        ValueChecked = '1'
        ValueUnchecked = '0'
        Visible = False
      end
      object cb2: TDBCheckBoxEh
        Left = 12
        Top = 308
        Width = 50
        Height = 17
        AllowGrayed = True
        AlwaysShowBorder = True
        Caption = 'cb2'
        Flat = True
        TabOrder = 19
        TabStop = False
        ValueChecked = '1'
        ValueUnchecked = '0'
        Visible = False
      end
      object cb3: TDBCheckBoxEh
        Left = 12
        Top = 328
        Width = 50
        Height = 17
        AllowGrayed = True
        AlwaysShowBorder = True
        Caption = 'cb3'
        Flat = True
        TabOrder = 20
        TabStop = False
        ValueChecked = '1'
        ValueUnchecked = '0'
        Visible = False
      end
    end
  end
  object QStreets: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(-1 as integer) as code, cast('#39' ---- '#39' as varchar(120' +
        ')) as street'
      '  from rdb$database'
      'union'
      'select s.code, s.street'
      '  from vw_streets s'
      '  where s.town_id = :ptown_id'
      '  order by 2')
    Left = 150
    Top = 44
    oFetchAll = True
    object QStreetsCODE: TFIBIntegerField
      FieldName = 'CODE'
    end
    object QStreetsSTREET: TFIBStringField
      FieldName = 'STREET'
      Size = 120
      EmptyStrToNull = True
    end
  end
  object QHouses: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(-1 as integer) as id, cast('#39' ---- '#39' as varchar(22)) ' +
        'as num, cast('#39#39' as varchar(16)) as house, cast(null as varchar(3' +
        ')) as corps'
      '  from rdb$database'
      'union'
      'select v.id, v.num, v.house, v.corps'
      '  from vw_buildings v'
      '  where v.street_id = :pstreet_id'
      '  order by 3,4')
    Left = 150
    Top = 76
    oFetchAll = True
    object QHousesID: TFIBIntegerField
      FieldName = 'ID'
    end
    object QHousesNUM: TFIBStringField
      FieldName = 'NUM'
      Size = 22
      EmptyStrToNull = True
    end
    object QHousesHOUSE: TFIBStringField
      FieldName = 'HOUSE'
      Size = 16
      EmptyStrToNull = True
    end
    object QHousesCORPS: TFIBStringField
      FieldName = 'CORPS'
      Size = 3
      EmptyStrToNull = True
    end
  end
  object QTowns: TpFIBDataSet
    SelectSQL.Strings = (
      'select'
      '    code,'
      '    name,'
      '    full_name'
      'from vw_towns '
      'where local = 1'
      
        'order by (select count(1) from rstreets where town_id = vw_towns' +
        '.code) desc, name')
    Left = 150
    Top = 12
    oFetchAll = True
    object QTownsNAME: TFIBStringField
      FieldName = 'NAME'
      Size = 60
      EmptyStrToNull = True
    end
    object QTownsCODE: TFIBIntegerField
      FieldName = 'CODE'
    end
    object QTownsFULL_NAME: TFIBStringField
      FieldName = 'FULL_NAME'
      Size = 123
      EmptyStrToNull = True
    end
  end
  object QApparts: TpFIBDataSet
    SelectSQL.Strings = (
      
        'select cast(0 as integer) as id, cast('#39' ---- '#39' as varchar(15)) a' +
        's num, '
      
        '       cast(-1 as integer) as apparts, cast(null as varchar(3)) ' +
        'as letter, '
      '       0 as acnt'
      '  from rdb$database'
      'union'
      'select max(v.id), v.num, v.apparts, v.letter, count(1) as acnt'
      '  from vw_abonents v'
      '  where v.building_id = :pbuilding_id'
      '    and v.client_id >= 0'
      '--    and v.is_active = 1'
      '  group by 2,3,4'
      '  order by 3,4')
    Transaction = MAINDM.pMainTransaction
    Database = MAINDM.pMainDatabase
    Left = 150
    Top = 108
    oFetchAll = True
    object QAppartsID: TFIBIntegerField
      FieldName = 'ID'
    end
    object QAppartsNUM: TFIBStringField
      FieldName = 'NUM'
      Size = 15
      EmptyStrToNull = True
    end
    object QAppartsAPPARTS: TFIBIntegerField
      FieldName = 'APPARTS'
    end
    object QAppartsLETTER: TFIBStringField
      FieldName = 'LETTER'
      Size = 3
      EmptyStrToNull = True
    end
    object QAppartsACNT: TFIBIntegerField
      FieldName = 'ACNT'
    end
  end
  object ds_QTowns: TDataSource
    DataSet = QTowns
    Left = 186
    Top = 12
  end
  object ds_QApparts: TDataSource
    DataSet = QApparts
    Left = 186
    Top = 108
  end
  object ds_QHouses: TDataSource
    DataSet = QHouses
    Left = 186
    Top = 76
  end
  object ds_QStreets: TDataSource
    DataSet = QStreets
    Left = 186
    Top = 44
  end
end
